/********************************************************************
	created:	2008/06/01
	created:	1:6:2008   15:54
	filename: 	x:\Lensow\Loplayer\src\app\CommandSink.h
	file path:	x:\Lensow\Loplayer\src\app
	file base:	CommandSink
	file ext:	h
	author:

	purpose:
*********************************************************************/
#pragma once

class CCommandSink
{
public:
	CCommandSink(CWnd* pWndMsgSink);
	virtual ~CCommandSink(void);

	LONG HandleEvent( LPCTSTR lpszCmd, const CComVariant& vEvent );
protected:
	LONG OnMaximize(const CComVariant&);
	LONG OnStop(const CComVariant&);
	LONG OnPrevious(const CComVariant&);
	LONG OnNext(const CComVariant&);
	LONG OnPlay(const CComVariant&);
	LONG OnMute(const CComVariant&);
	LONG OnControlPanel(const CComVariant&);
	LONG OnPlaylist(const CComVariant&);

	CWnd* GetSinkWnd () const	{ASSERT(m_pWndMsgSink); return m_pWndMsgSink;}
private:
	typedef LONG (CCommandSink::*SKIN_PHANDLE)(const CComVariant&);
	struct SKIN_HANDLEMAP_ENTRY {
		LPCTSTR		szCommand;
		UINT		message;
		WPARAM      wParam;
		LPARAM      lParam;
		SKIN_PHANDLE pfn;    // routine to call (or special value)
	};
	static SKIN_HANDLEMAP_ENTRY	s_HandleEntries[];

	CWnd* m_pWndMsgSink;
};
